@extends('admin.layout.main')

@section('content')
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
<ul class="breadcrumb">
	<li>
		<i class="ace-icon fa fa-home home-icon"></i>
		<a href="#">首页</a>
	</li>
    <li><a href="#">法币交易</a></li>
	<li><a href="#">认证审核列表</a></li>
	<li class="active"><a href="/admin/confirm_currency?turn_id=">审核 </a></li>
</ul><!-- /.breadcrumb -->

</div>
<div class="page-content">
    <div class="col-xs-12 col-sm-3 center">
        <div>
            <span class="profile-picture">
                <img id="avatar" class="editable img-responsive" alt="{{$user->nickname}}"
                src="{{$os}}/{{$user->headimg}}" />
            </span>

            <div class="space-4"></div>

            <div class="width-80 label label-info label-xlg arrowed-in arrowed-in-right">
                <div class="inline position-relative">
                    <a href="#" class="user-title-label dropdown-toggle" data-toggle="dropdown">
                        <i class="ace-icon fa fa-circle light-green"></i>
                        &nbsp;
                        <span class="white">{{$user->nickname}}</span>
                    </a>

                </div>
            </div>
        </div>

        <div class="space-6"></div>

        <div class="profile-contact-info">
			<div class="profile-contact-links align-left">
				@if($user->enters)
				<a href="#" class="btn btn-link">
					QQ :{{$user->enters->qq}}
				</a>
				
				<a href="#" class="btn btn-link">
				Phone :{{$user->enters->phone}}
				</a>

				<a href="#" class="btn btn-link">
				Email :{{$user->enters->email}}
				</a>
				@endif
			</div>

		</div>
    </div>

    <div class="col-xs-12 col-sm-9">    

		<div class="profile-user-info profile-user-info-striped">
				<div class="profile-info-row">
					<div class="profile-info-name"> 用户资产</div>
					<div class="profile-info-value">可用余额</div>
	                <div class="profile-info-value">冻结余额</div>
				</div>
			@foreach($user->property as $val)
				@if($val->currency)
					@if($val->currency->name_en == 'OBA')
		            <div class="profile-info-row">
		                <div class="profile-info-name"> {{$val->currency->name_en}}</div>
		                <div class="profile-info-value">{{$val->balance}}</div>
		                <div class="profile-info-value">30000.00000000</div>
		            </div>
		            @endif
	            @endif
 			@endforeach
		</div>

		<div class="space-12"></div>

		<div class="profile-user-info profile-user-info-striped">
            <div class="profile-info-row">
				<div class="profile-info-name"> 真实姓名</div>

				<div class="profile-info-value">
					<span class="editable" id="username">
						@if($user->autonym)
							{{$user->autonym->name}}
						@endif
					</span>
				</div>
			</div>

			<div class="profile-info-row">
				<div class="profile-info-name"> 身份证号码</div>

				<div class="profile-info-value">
					<span class="editable" id="username">
						@if($user->autonym)
							{{$user->autonym->indentity_card}}
						@endif
					</span>
				</div>
			</div>

			<div class="profile-info-row">
				<div class="profile-info-name"> 正面照片</div>

				<div class="profile-info-value">
					<span class="editable" id="username">
						@if($user->autonym)
							<img src= "{{$os}}/{{$user->autonym->front_card}}" width="200" height="100">
						@endif
					</span>
				</div>
			</div>

			<div class="profile-info-row">
				<div class="profile-info-name"> 背面照片</div>

				<div class="profile-info-value">
					<span class="editable" id="username">
						@if($user->autonym)
							<img src="{{$os}}/{{$user->autonym->back_card}}" width="200" height="100">
						@endif
					</span>
				</div>
			</div>
			<div class="profile-info-row">
				<div class="profile-info-name"> 手持照片</div>

				<div class="profile-info-value">
					<span class="editable" id="username">
						@if($user->autonym)
							<img src="{{$os}}/{{$user->autonym->hand_card}}" width="200" height="100">
						@endif
					</span>
				</div>
			</div>
			<div class="profile-info-row">
				<div class="profile-info-name"> 备注</div>

				<div class="profile-info-value">
					<span class="editable" id="username">
						<textarea name="note" rows="10" cols="60" id="noteContent"></textarea>
					</span>
				</div>
			</div>
		</div>

		<div class="space-12"></div>

		<div class="center">
            <a href="javascript::;" onclick="onSuccess()">
                <button class="btn btn-info" type="submit">
                    <i class="ace-icon fa fa-check bigger-110"></i>
                    审核通过
                </button>
            </a>
            &nbsp; &nbsp; &nbsp;
            <a href="javascript::;" onclick="onFail()">
                <button class="btn" type="reset">
                    <i class="ace-icon fa fa-undo bigger-110"></i>
                    审核失败
                </button>
            </a>
		</div>

    </div>
</div>
@endsection
@section('after.js')
<script type="text/javascript">
	function onSuccess()
	{
		var $note = document.getElementById("noteContent").value;
		var $uid = {{$user->id}};
		window.location.href='/admin/update_audit_status?uid='+$uid+'&status=1&note='+$note;
	}

	function onFail()
	{
		var $note = document.getElementById("noteContent").value;
		var $uid = {{$user->id}};

		window.location.href='/admin/update_audit_status?uid='+$uid+'&status=2&note='+$note;
	}

</script>
@endsection
